import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Home from "../views/Home";
import ArticleList from "../components/article/ArticleList";
import ArticlePublish from "../components/article/ArticlePublish";
import CategoryManage from "../components/category/CategoryManage";
import DataManage from "../components/data/DataManage";
import UserManage from "../components/user/UserManage";


Vue.use(VueRouter)

  const routes = [
    {
      path:"/",
      name:"Login",
      component:Login,
      hidden:true
    },
    {
      path: '/Home',

      component: Home,
      hidden:true
    },
      {
          path : '/Home',
          name : 'Home',
          component : Home,
          meta :{
              isChildOption :true,
              title : '文章管理',
              icons : 'el-icon-document-copy'
          },
          children : [
              {
                  path : '/ArticleList',
                  name : 'ArticleList',
                  component : ArticleList,
                  meta :{
                      title : '文章列表',
                  }
              },
              {
                  path : '/ArticlePublish',
                  name : 'ArticlePublish',
                  component : ArticlePublish,
                  meta :{
                      title : '文章发布',
                  }
              },
          ]
      },
      {
          path : '/Home',
          name : 'Home',
          component : Home,
          meta :{
              isChildOption :false,
          },
          children : [
              {
                  path : '/CategoryManage',
                  name : 'CategoryManage',
                  component : CategoryManage,
                  meta :{
                      title : '栏目管理',
                      icons : 'el-icon-menu'
                  }
              },
              {
                  path : '/UserManage',
                  name : 'UserManage',
                  component : UserManage,
                  meta :{
                      title : '用户管理',
                      icons : 'el-icon-s-custom'
                  }
              },
              {
                  path : '/DataManage',
                  name : 'DataManage',
                  component : DataManage,
                  meta :{
                      title : '数据统计',
                      icons : 'el-icon-s-data'
                  }
              },
          ]
      },
]

const router = new VueRouter({
  routes
})

export default router
